# -*- coding: utf-8 -*-
# @Time    : 2021/9/26 16:06
# @Author  : xiao
import unittest

from basic.utils.getCaseReportXml import get_report


class CaseRunner(unittest.TestCase):

    @staticmethod
    def caseResult(run, type):
        print("本次执行用例数：")
        nub = run.testsRun
        print(nub)
        print('成功用例数：')
        seccess = run.success_count
        print(seccess)
        result_list=run.result_list
        return get_report(result_list, nub, seccess, nub - seccess, type)

    @staticmethod
    def runCases(classNameList):
        suite = unittest.TestSuite()
        for className in classNameList:
            suite.addTest(unittest.TestSuite(unittest.makeSuite(className)))
        return suite


